Skip to content

chore: cover realtime tool timeout behaviors in realtime session#3076

Open
Aphroq wants to merge 2 commits intoopenai:mainfrom
Aphroq:chore/realtime-timeout-tests
Open

chore: cover realtime tool timeout behaviors in realtime session#3076
Aphroq wants to merge 2 commits intoopenai:mainfrom
Aphroq:chore/realtime-timeout-tests

Conversation

@Aphroq
Copy link
Copy Markdown
Contributor

@Aphroq Aphroq commented May 1, 2026

Summary

This pull request adds focused realtime session coverage for tool timeout branches that were not exercised directly.

Test plan

  • uv run pytest tests/realtime/test_session.py -q

Issue number

N/A

Checks

  • I've added new tests (if relevant)
  • I've added/updated the relevant documentation
  • I've run make lint and make format
  • I've made sure tests pass

@Aphroq Aphroq changed the title test: cover realtime tool timeout behaviors in realtime session chore: cover realtime tool timeout behaviors in realtime session May 1, 2026
Copy link
Copy Markdown
Member

@seratch seratch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the CI error?

@openai openai deleted a comment from chatgpt-codex-connector Bot May 1, 2026
@openai openai deleted a comment from chatgpt-codex-connector Bot May 1, 2026
@openai openai deleted a comment from chatgpt-codex-connector Bot May 2, 2026
@seratch
Copy link
Copy Markdown
Member

seratch commented May 2, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 25d37238de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/realtime/test_session.py Outdated
Comment on lines +1171 to +1174
for _ in range(10):
if session._event_queue.qsize() >= 3:
break
await asyncio.sleep(0.01)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Wait deterministically for queued tool-call error event

Replace the fixed 100ms poll loop with a deterministic wait for the RealtimeError event. _on_tool_call_task_done enqueues the error via asyncio.create_task(...), so under load the event may arrive after this loop exits, making next(...RealtimeError...) raise despite correct behavior. This introduces a flaky timeout test.

Useful? React with 👍 / 👎.

@seratch seratch marked this pull request as draft May 2, 2026 00:17
Aphroq added 2 commits May 2, 2026 11:23
Add focused realtime session tests for tool timeout branches.

- cover direct _handle_tool_call() behavior for timeout_behavior="raise_exception"
- cover async timeout_error_function output handling
- cover async on_event() failure propagation into RealtimeError
@Aphroq Aphroq force-pushed the chore/realtime-timeout-tests branch from 25d3723 to 82eb4b6 Compare May 2, 2026 11:54
@Aphroq Aphroq marked this pull request as ready for review May 2, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants